<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>题目类型管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		function checkTypeNameValidate()
		{
			var typeName=document.getElementById("subjectTypeName").value;
			if(typeName==null||typeName=="")
			{
				window.alertx("请输入题目类型名称！");
				return false;
			}
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/resource/resourceCtfSubject/">CTF题目列表</a></li>
		<shiro:hasPermission name="resource:resourceCtfSubject:edit"><li><a href="${ctx}/resource/resourceCtfSubject/form">CTF题目添加</a></li></shiro:hasPermission>
		<shiro:hasPermission name="resource:resourceCtfSubject:edit"><li class="active"><a href="${ctx}/resource/resourceCtfSubject/subjectTypeList">题目类型管理</a></li></shiro:hasPermission>
	</ul>
	<form:form id="inputForm" action="${ctx}/resource/resourceCtfSubject/subjectTypeSave" method="post" class="form-horizontal">
	<div class="control-group">
		<label class="control-label">题目类型名称：</label>
		<div class="controls">
			<input type="text" name="subjectTypeName" id="subjectTypeName" maxlength="64" class="input-xlarge required"/>
			<shiro:hasPermission name="resource:resourceCtfSubject:edit"><input id="btnSubmit" class="btn" type="submit" value="保 存" style="margin-left: 10px" onclick="return checkTypeNameValidate()"/>&nbsp;</shiro:hasPermission>
		</div>
	</div>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>序号</th>
				<th>题目类型名称</th>
				<shiro:hasPermission name="resource:resourceCtfSubject:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="subjectType" varStatus="status">
			<tr>
				<td>
						${status.count}
				</td>
				<td>
					${subjectType.subjectTypeName}
				</td>
				<shiro:hasPermission name="resource:resourceCtfSubject:edit">
					<td>
					<a href="${ctx}/resource/resourceCtfSubject/subjectTypeDelete?id=${subjectType.id}" onclick="return confirmx('确认要删除该题目类型吗？', this.href)">删除</a>
					</td>
				</shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
	<div class="form-actions">
		<%--<shiro:hasPermission name="resource:resourceCtfSubject:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" onclick="return checkValidate()"/>&nbsp;</shiro:hasPermission>--%>
		<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
	</div>
</body>
</html>